//
//  SEGSliderView.h
//  Tab分页策划测试
//
//  Created by 刘山 on 16/10/1.
//  Copyright © 2016年 刘山. All rights reserved.
//

#import <UIKit/UIKit.h>

static NSString* SEGSliderViewTitleIdentifier = @"_SEGSliderViewTitleIdentifier";
static NSString* SEGSliderViewContentIdentifier = @"_SEGSliderViewContentIdentifier";

@protocol SEGSliderTitleViewCellDelegate <NSObject>
- (void)SliderTitleClickWithIndexPath:(NSIndexPath*)indexPath;
@end

@interface SEGSliderTitleViewCell : UICollectionViewCell
@property (nonatomic, strong) UIButton* titleBtn;
@property (nonatomic, strong) UIView* lineView;
@end

@interface SEGSliderContentViewCell : UICollectionViewCell
@property (nonatomic, strong) UIViewController* rootViewController;
@property (nonatomic, assign) CGSize superContentSize;
@end

@protocol SEGSliderViewDelegate <NSObject>
@optional
- (void)sliderView_back;
- (void)sliderView_Seleted:(NSInteger)idnex;
@end

@interface SEGSliderView : UIView
@property (nonatomic, strong) NSArray<UIViewController*>* dataSource;
@property (nonatomic, assign) NSInteger startIndex;
@property (nonatomic, assign) id<SEGSliderViewDelegate> delegate;
@property (nonatomic, strong) UIButton* backBtn;
@property (nonatomic, strong) UICollectionView* titleCollectionView;
@property (nonatomic, strong) UICollectionView* contentCollectionView;

@property (nonatomic, strong) UICollectionViewFlowLayout* titleLayout;
@property (nonatomic, strong) UICollectionViewFlowLayout* contentLayout;

@property (nonatomic, strong) NSIndexPath* oldIndexPath;
@property (nonatomic, strong) NSIndexPath* currentIndexPath;

@property (nonatomic, assign) NSInteger collectionViewTag;
@property (nonatomic, assign) id<SEGSliderTitleViewCellDelegate> titledelegate;
@property (nonatomic, strong) UIView* lineView;
@property (nonatomic, strong) UIView* titleLineView;

@property (nonatomic, strong) NSTimer* timer;
//@property (nonatomic, strong) NSTimer* contenttimer;
@property (nonatomic, assign) BOOL showBackBtn; //显示返回按钮
@property (nonatomic, assign) NSInteger showCount; //一个屏幕中最多同时显示按钮个数
@property (nonatomic, assign) NSInteger currentIndex; //一个屏幕中最多同时显示按钮个数 默认6个
@property (nonatomic, assign) BOOL isCloseContentScroll; //是否关闭内容侧滑
-(void)setPageWithIndex:(NSInteger)index;
@end
